#include <iostream>
#include <fstream>
using namespace std;
const static int bufferLength=2048;
bool copy_file(const string& src,const string& dst) {
	ifstream in(src,ios::in|ios::binary);
	fstream out(dst,ios::out|ios::binary|ios::trunc);
	if(!in && !out) {
		cout<<"文件读写失败"<<endl;
		return false;
	}
	char temp[bufferLength];
	while(!in.eof()) {
		in.read(temp, bufferLength);
		streamsize count=in.gcount();
		out.write(temp, count);
	}
	out.close();
	in.close();
	return true;
}
int main() {
	cout<<copy_file("182c0490678cacabb309b4a0cb655ff.jpg","a jpg")<<endl;
}